package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.AnnotationValueBytecodeEvent;

public class AnnotationValueBytecodeEventImpl extends BytecodeEventImpl implements AnnotationValueBytecodeEvent
{
    private String name;
    private Object value;

    public AnnotationValueBytecodeEventImpl(final String aName, final Object aValue) {
        name = aName;
        value = aValue;
    }

    @Override
    public int getType() {
        return ANNOTATION_VALUE;
    }

    @Override
    public void setName(final String aName) {
        name = aName;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setValue(final Object aValue) {
        value = aValue;
    }

    @Override
    public Object getValue() {
        return value;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeAnnotationVisitor().visitAnnotationValue(this);
        return aBytecodeVisitor;
    }
}
